/** ele admin 公共类  license by http://eleadmin.com */
@import './var.scss';

body {
  color: $--color-text-regular;
  font-size: $--font-size-base;
  background-color: $--layout-body-background;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

a {
  text-decoration: none;
  color: $--color-primary;

  &:hover {
    color: $--color-primary-light-2;
  }
}

/* 辅助类 */
// 页面主体
.ele-body {
  padding: 15px;

  &.ele-body-card {
    padding-bottom: 0;

    .el-card {
      margin-bottom: 15px;
    }
  }
}

// 标题
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: normal;
  color: $--color-text-primary;
  font-size: $--font-size-medium;
}

h5 {
  font-size: ($--font-size-medium + 2px);
}

h4 {
  font-size: ($--font-size-medium + 4px);
}

h3 {
  font-size: ($--font-size-medium + 6px);
}

h2 {
  font-size: ($--font-size-medium + 8px);
}

h1 {
  font-size: ($--font-size-medium + 10px);
}

// 文字
.ele-text {
  color: $--color-text-regular;
}

.ele-text-heading {
  color: $--color-text-primary;
}

.ele-text-secondary {
  color: $--color-text-secondary;
}

.ele-text-placeholder {
  color: $--color-text-placeholder;
}

.ele-text-primary {
  color: $--color-primary;
}

.ele-text-success {
  color: $--color-success;
}

.ele-text-warning {
  color: $--color-warning;
}

.ele-text-danger {
  color: $--color-danger;
}

.ele-text-info {
  color: $--color-info;
}

.ele-text-delete {
  text-decoration: line-through;
}

.ele-text-small,
.ele-text-small > .el-progress__text {
  font-size: $--font-size-extra-small !important;
}

.ele-bg-base {
  background-color: $--layout-body-background !important;
}

.ele-bg-primary {
  background-color: $--color-primary !important;
}

.ele-bg-success {
  background-color: $--color-success !important;
}

.ele-bg-warning {
  background-color: $--color-warning !important;
}

.ele-bg-danger {
  background-color: $--color-danger !important;
}

.ele-bg-info {
  background-color: $--color-info !important;
}

.ele-bg-info-lighter {
  background-color: $--color-info-lighter !important;
}

.ele-bg-white {
  background-color: $--color-white !important;
}

.ele-border-primary {
  border-color: $--color-primary !important;
}

.ele-border-success {
  border-color: $--color-success !important;
}

.ele-border-warning {
  border-color: $--color-warning !important;
}

.ele-border-danger {
  border-color: $--color-danger !important;
}

.ele-border-info {
  border-color: $--color-info !important;
}

// 元素浮动、对齐
.ele-pull-left {
  float: left;
}

.ele-pull-right {
  float: right;
}

.ele-clear {
  clear: both;
}

.ele-clear-after:after {
  content: '';
  clear: both;
  display: block;
}

.ele-text-center {
  text-align: center;
}

.ele-text-left {
  text-align: left;
}

.ele-text-right {
  text-align: right;
}

.ele-fluid {
  width: 100% !important;
}

.ele-block {
  display: block;
}

.ele-inline-block {
  display: inline-block;
}

.ele-inline {
  display: inline;
}

// 占位元素
em:not([class]) {
  padding: 0 0.5em;
  font-style: normal;
}

s:not([class]) {
  padding: 0 0.125em;
  font-style: normal;
}

// 按钮加图标减少间距
.ele-btn-icon,
.ele-btn-icon.is-round {
  padding-left: 12px;
  padding-right: 12px;

  &.el-button--small {
    padding-left: 10px;
    padding-right: 10px;
  }

  &.el-button--mini {
    padding-left: 8px;
    padding-right: 8px;
  }
}

// 相邻操作类元素加间距
.el-button + .el-link,
.el-button + .el-dropdown,
.el-button + .ele-action,
.el-link + .el-button,
.el-link + .el-link,
.el-link + .el-dropdown,
.el-link + .ele-action,
.el-dropdown + .el-button,
.el-dropdown + .el-link,
.el-dropdown + .el-dropdown,
.el-dropdown + .ele-action,
.ele-action + .el-button,
.ele-action + .el-link,
.ele-action + .el-dropdown,
.ele-action + .ele-action,
.el-tag + .el-tag {
  margin-left: 10px;
}

.el-select .el-tag + .el-tag,
.el-cascader__tags .el-tag + .el-tag {
  margin-left: 6px;
}

.ele-action-group {
  & > .el-button,
  & > .el-link,
  & > .el-dropdown,
  & > .el-tag,
  & > .ele-action {
    margin-top: 5px;
    margin-bottom: 5px;
  }
}

.ele-space {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}

// 文字省略
.ele-elip {
  overflow: hidden;
  white-space: nowrap;
  word-break: break-all;
  text-overflow: ellipsis;
}

/* 单元格 */
.ele-cell {
  display: flex;

  &:not(.ele-cell-align-top) {
    align-items: center;
  }

  &.ele-cell-align-bottom {
    align-items: flex-end;
  }

  & > .ele-cell-content {
    flex: 1;
    box-sizing: border-box;
  }

  & > * + .ele-cell-content {
    padding-left: 10px;
  }

  .ele-cell-title {
    color: $--color-text-primary;
    font-size: 15px;
  }

  .ele-cell-desc {
    color: $--color-text-secondary;
    font-size: 13px;
    margin-top: 8px;
  }
}

/* 顶部标题 */
.ele-page-header {
  padding: 20px 25px 16px 25px;
  background: $--color-white;
  border-bottom: 1px solid $--border-color-extra-light;

  .ele-page-title {
    font-size: 19px;
    color: $--color-text-primary;
  }

  .ele-page-desc {
    margin-top: 8px;
    color: $--color-text-secondary;
  }
}

/* 底部工具栏 */
.ele-bottom-tool {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 10px 15px;
  box-sizing: border-box;
  background: $--color-white;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
  transition: padding-left $--sidebar-transition-anim;
  z-index: $--layout-z-index - 1;

  .ele-bottom-tool-actions {
    flex: 1;
    text-align: right;
  }
}

@media screen and (min-width: 768px) {
  .ele-admin-sidebar + .ele-admin-body .ele-bottom-tool {
    padding-left: ($--sidebar-width + 15px);
  }

  .ele-layout-collapse .ele-admin-sidebar + .ele-admin-body .ele-bottom-tool {
    padding-left: ($--sidebar-collapse-width + 15px);
  }
}

/* 数据表格头部工具栏 */
.ele-table-tool {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;

  .ele-table-tool-title {
    flex: auto;
    margin-top: 5px;
    margin-bottom: 5px;
  }

  .ele-tool {
    margin: 5px 0 5px auto;

    .ele-tool-item {
      font-size: 18px;
      padding: 0 2px;
      cursor: pointer;

      .el-dropdown > i {
        font-size: 18px;
      }
    }
  }

  &.ele-toolbar-form .ele-table-tool-title {
    margin-top: 0;
    margin-bottom: 0;

    .el-form-item,
    .ele-form-actions {
      margin-top: 5px;
      margin-bottom: 5px;
    }
  }

  &.ele-toolbar-actions .ele-table-tool-title {
    margin-top: 0;
    margin-bottom: 0;

    & > .el-button,
    & > .el-link,
    & > .el-dropdown,
    & > .el-tag,
    & > .ele-action {
      margin-top: 5px;
      margin-bottom: 5px;
    }
  }

  &:not(.ele-table-tool-default):not(.ele-table-tools-none)
    .ele-tool
    .ele-tool-item {
    padding: 6px;
    line-height: 1;
    text-align: center;
    border: 1px solid $--border-color-base;
    border-radius: 50%;
    font-size: 14px;

    .el-dropdown > i {
      font-size: 14px;
    }

    &:hover {
      color: $--color-primary;
      border-color: $--color-primary-light-8;
      background-color: $--color-primary-light-9;

      .el-dropdown > i {
        color: $--color-primary;
      }
    }
  }
}

// 带背景色
.ele-table-tool-default {
  margin-bottom: 0;
  padding: 5px 15px;
  box-sizing: border-box;
  background: $--table-header-background-color;
  border-top: 1px solid $--border-color-lighter;
  border-left: 1px solid $--border-color-lighter;
  border-right: 1px solid $--border-color-lighter;

  .ele-tool .ele-tool-item {
    font-size: 16px;
    padding: 5px 6px;
    border-radius: 2px;
    border: 1px solid $--border-color-light;
    box-sizing: border-box;
    line-height: 1;

    .el-dropdown > i {
      font-size: 16px;
    }
  }
}

/* 表单详情 */
.ele-form-detail .el-form-item {
  margin-bottom: 10px;
}

/* 水平搜索表单 */
.ele-form-search .el-form-item,
.ele-form-search .ele-form-actions {
  margin-bottom: 15px;
}

@media screen and (min-width: 768px) {
  .ele-form-search.el-form--inline
    .el-form-item:not(.ele-form-actions)
    .el-form-item__content {
    max-width: 200px;
  }

  .ele-form-search.el-form--inline .ele-form-actions {
    padding-left: 15px;
  }
}

@media screen and (max-width: 768px) {
  .el-form--inline .el-form-item {
    display: flex;
    margin-right: 0;
  }

  .el-form--inline .el-form-item__content {
    flex: 1;
  }

  .ele-form-search .ele-form-actions {
    text-align: right;
  }
}

/* 级联选择器增加高度 */
.ele-pop-wrap-higher .el-cascader-menu__wrap {
  height: 280px;
}

/* 图表提示框圆点 */
.ele-chart-dot {
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 50%;
  display: inline-block;
  background: #3aa1ff;
}

/* 滚动条 */
@media screen and (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 5px;
  }

  ::-webkit-scrollbar-thumb {
    border-radius: 6px;
    border: 2px solid transparent;
    background-color: $--scrollbar-background-color;
    background-clip: padding-box;
  }

  ::-webkit-scrollbar-thumb:hover {
    background-color: $--scrollbar-hover-background-color;
  }

  ::-webkit-scrollbar-corner {
    background: transparent;
  }

  .ele-scrollbar-mini::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  .ele-scrollbar-mini::-webkit-scrollbar-track {
    background: none;
  }

  .ele-scrollbar-mini::-webkit-scrollbar-thumb {
    border-radius: 3px;
    border: none;
  }
}

.ele-scrollbar-hover,
.ele-scrollbar-hide {
  overflow: auto;
}

.ele-scrollbar-hide::-webkit-scrollbar,
.ele-scrollbar-hover:not(:hover)::-webkit-scrollbar {
  width: 0;
  height: 0;
}
